﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace WindowsGame1
{
    class Item
    {
        Texture2D texturaItem;
        public Rectangle recPosicaoItem;
        Vector2 velocidade = new Vector2(0, 5);
        public Vector2 posicao;
        Random rnd = new Random();
        float direcao = 1;
        public int tipoItem;

        public Item(Texture2D texturaItem, int tipoItem)
        {
            this.texturaItem = texturaItem;
            posicao.X = rnd.Next(10, 750);
            this.tipoItem = tipoItem;
        }

        public void Update(GameTime gameTime)
        {
            posicao.Y += direcao * velocidade.Y;
            recPosicaoItem = new Rectangle((int)posicao.X, (int)posicao.Y, 40, 40);
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texturaItem, recPosicaoItem, Color.White);
        }
    }
}
